﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.SharePoint.Administration;
using Trentacular.SharePoint.Deployment.Views;

namespace Trentacular.SharePoint.Deployment
{
    /// <summary>
    /// Interaction logic for Main.xaml
    /// </summary>
    public partial class Main : Window
    {
        static Main()
        {
            BaseView.IsDoingWorkProperty.AddOwner(typeof(Main));
        }

        public Main()
        {
            SolutionsExplorer = new SolutionsExplorer(this);

            InitializeComponent();
        }

        public SolutionsExplorer SolutionsExplorer { get; private set; }

        private void solutionsTreeView_Loaded(object sender, RoutedEventArgs e)
        {
            // Select the root node in the treeview by default
            TreeViewItem item = (TreeViewItem)solutionsTreeView.ItemContainerGenerator.ContainerFromIndex(0);
            item.IsSelected = true;
        }

        private void exitMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void aboutMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var about = new About();
            about.ShowDialog();
        }
    }
}
